home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************************/
- /* */
- /* Program Name: Stiletto */
- /* */
- /* File Name: CHRSModules.h */
- /* */
- /* © Apple Computer, Inc. 1991-1995 */
- /* All Rights Reserved */
- /* */
- /* Revision History: */
- /* */
- /* Date Who Modification */
- /* */
- /* 1991-09-28 Chris Halim Original version */
- /* 1995-06-26 Jaakko Railo Version 2.0 */
- /* */
- /************************************************************************************************/
-
- /****************************************** DESCRIPTION ******************************************
-
- *************************************************************************************************/
-
- /************************************************************************************************/
- /************************************************************************************************/
-
-
- #ifndef __CHRSMODULES__
- #define __CHRSMODULES__
-
- #ifndef __TELEPHONES__
- #include "Telephones.h"
- #endif
-
- #ifndef __LOGWINDOW__
- #include "LogWindow.h"
- #endif
-
-
- #define kModuleType 'CHRS'
-
- enum {
- kModuleID = 128 // resource ID for the CHRS module
- };
-
- enum {
- kTestModuleVersion = 3 // current version of CHRS format
- };
-
- enum {
- kWrongVersion = -1 // error code for running incompatible module
- };
-
- enum { // callback codes
- getCurrentTELHandleRequest = 1,
- getCAHandleRequest = 2,
- getDNHandleRequest = 3,
- printRequest = 4
- };
-
- enum { // result codes in CHRSBlock.result
- requestSuccess = 0,
- requestFail = 1,
- requestNotImplemented = 2
- };
-
-
- #if defined(powerc) || defined (__powerc)
- #pragma options align=mac68k
- #endif
- struct CHRSBlock {
- // short paramCount; // XMOD
- // Handle params[16]; // XMOD
- // Handle returnValue; // XMOD
- // Boolean passFlag; // XMOD
-
- short version; // module version number NO XMOD
-
- UniversalProcPtr entryPoint; // call back to Stiletto
-
- short request; // code for call back function
- short result; // result of calling back (succ, fail, etc.)
- long inArgs[8]; // arguments sent by CHRS modules to Stiletto
- long outArgs[4]; // answers returns by Stiletto
- };
- #if defined(powerc) || defined(__powerc)
- #pragma options align=reset
- #endif
-
- typedef struct CHRSBlock CHRSBlock;
-
- typedef CHRSBlock *CHRSPtr;
-
-
- typedef void (*EntryPointProcPtr) (CHRSPtr paramPtr);
-
- #if GENERATINGCFM
- typedef UniversalProcPtr EntryPointUPP;
- #else
- typedef EntryPointProcPtr EntryPointUPP;
- #endif
-
- enum {
- uppEntryPointProcInfo = kCStackBased
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(CHRSPtr)))
- };
-
- #if GENERATINGCFM
- #define NewEntryPointProc(userRoutine) \
- (EntryPointUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppEntryPointProcInfo, GetCurrentISA())
- #else
- #define NewEntryPointProc(userRoutine) \
- ((EntryPointUPP) (userRoutine))
- #endif
-
- #if GENERATINGCFM
- #define CallEntryPointProc(userRoutine, paramPtr) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppEntryPointProcInfo, (paramPtr))
- #else
- #define CallEntryPointProc(userRoutine, paramPtr) \
- (*(userRoutine))((paramPtr))
- #endif
-
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
-
- extern pascal TELHandle GetCurrentTELHandle (CHRSPtr paramPtr);
-
- /**
- ** GetCurrentTELHandle will return the TELHandle currently used by
- ** Stiletto.
- **
- **/
-
- extern pascal TELCAHandle GetCAHandle (CHRSPtr paramPtr);
-
- /**
- ** GetCAHandle will display a list of CAs currently in used. Users
- ** will then pick a CA from this list.
- **
- **/
-
- extern pascal TELDNHandle GetDNHandle (CHRSPtr paramPtr);
-
- /**
- ** GetDNHandle will display a list of DNs currently in used. Users
- ** will then pick a DN from this list.
- **
- **/
-
- extern void Print (CHRSPtr paramPtr, const char * format, ...);
-
- /**
- ** This is a call back routine to allow modules to print directly onto
- ** the default log window of the host application. The format is similar
- ** to C printf. Because of the nature of this routine, it cannot be called
- ** from Pascal.
- **
- **/
-
-
- extern pascal Boolean StandardFilterProc(DialogPtr theDialog, EventRecord * theEvent, short * itemHit);
-
- /**
- ** This routine can be used as a ModalDialog filter proc. This filter
- ** allows command-period and esc-key to be interpreted as a hit on item 2
- ** (usually the cancel button)
- **
- **/
-
-
- #ifdef __cplusplus
- }
- #endif
-
-
- #endif
-